package com.loan.web.api;

import com.loan.entity.MortgageCategory;
import com.loan.entity.ResponseResult;
import com.loan.service.MortgageCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description:资产分类处理器
 * @Author:l
 * @Date:2022.01.18
 */
@RestController
@RequestMapping("/api/category")
public class MortgageCategoryController {

    @Autowired
    private MortgageCategoryService mortgageCategoryService;

    @RequestMapping("/list")
    public ResponseResult<List<MortgageCategory>> list(){

        List<MortgageCategory> categories = mortgageCategoryService.list();
        return new ResponseResult<List<MortgageCategory>>(categories);

    }
}
